//package com.zzh.partnersys.im.rocketmq.consumer;
//
//import com.zzh.partnersys.chat.message.request.ChatRequestMessage;
//import com.zzh.partnersys.entity.FriendMessageDO;
//import com.zzh.partnersys.rocketmq.contant.MQConstant;
//import com.zzh.partnersys.service.FriendMessageService;
//import com.zzh.partnersys.utils.FriendKeyUtils;
//import org.apache.rocketmq.spring.annotation.MessageModel;
//import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
//import org.apache.rocketmq.spring.core.RocketMQListener;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Component;
//
///**
// * @author ??????
// * @version 1.0
// * �����ĵ���Ϣ������??
// */
//@RocketMQMessageListener(
//        topic = MQConstant.CHAT_ONE_TOPIC,
//        consumerGroup = MQConstant.CONSUMER_GROUP_ONE_CHAT,
//        messageModel = MessageModel.BROADCASTING)
//@Component
//public class ChatOneMQConsumer implements RocketMQListener<ChatRequestMessage> {
//
//    @Autowired
//    private FriendMessageService friendMessageService;
//
//    @Override
//    public void onMessage(ChatRequestMessage chatRequestMessage) {
//
//        //����ֱ�ӷ�����??
//        Long fromUid = chatRequestMessage.getFromUid();//˭������??
//        Long toUid = chatRequestMessage.getUid();//���͸��ĸ��û�
//        String content = chatRequestMessage.getContent();//��Ϣ����
//
//        //������Ϣ��������
//        FriendMessageDO friendMessage = new FriendMessageDO();
//        friendMessage.setFriendKey(FriendKeyUtils.getFriendKeyUID(toUid,fromUid));
//        friendMessage.setFromUid(fromUid);
//        friendMessage.setContent(content);
//
//        Long id = friendMessageService.insertData(friendMessage);
//        if (id != null){
//            //��Ϣ�洢�ɹ�
//        }else {
//            //todo ��Ϣ�洢ʧ�ܣ���·���⣿���ݿ���??
//        }
//
//    }
//
//
//}
